package com.zf.yichat.service.impl;

import com.zf.yichat.mapper.UserFeedbackMapper;
import com.zf.yichat.mapper.UserFeedbackMoneyMapper;
import com.zf.yichat.model.UserFeedbackMoney;
import com.zf.yichat.service.UserFeedbackMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserFeedbackMoneyServiceImpl implements UserFeedbackMoneyService {

    @Resource
    private UserFeedbackMoneyMapper userFeedbackMoneyMapper;

    @Override
    public void save(String content, Long userId, Integer type, String orderId) {
        UserFeedbackMoney feedbackMoney = new UserFeedbackMoney();
        feedbackMoney.setContent(content);
        feedbackMoney.setUserId(userId);
        feedbackMoney.setType(type);
        feedbackMoney.setOrderId(orderId);
        feedbackMoney.setStatus(0);
        userFeedbackMoneyMapper.insertSelective(feedbackMoney);

    }

    @Override
    public List<UserFeedbackMoney> get() {
        List<UserFeedbackMoney> userFeedbackMonies = userFeedbackMoneyMapper.selectAll();
        return userFeedbackMonies;
    }
}
